package com.yimi.policyservice.dto;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

import java.util.List;

public   class PageDto <T> {
    private List<T> content ;
    private long total ;

    public List<T> getContent() {
        return content;
    }

    public void setContent(List<T> content) {
        this.content = content;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public PageDto(Page res) {
        this.content = res.getResult();
        PageInfo info = new PageInfo<>(res.getResult());
        res.setTotal(info.getTotal());
        this.total = res.getTotal();
    }
}
